﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 易容酒店管理系统
{
    public partial class Software_registration : Form
    {
        public Software_registration()
        {
            InitializeComponent();
        }

        private void picReturn_Click(object sender, EventArgs e)
        {
            Main_function newzMain_function = new Main_function();
            newzMain_function.Show();
            newzMain_function.TopLevel = false;
            Method.frm.panel1.Controls.Clear();
            Method.frm.panel1.Controls.Add(newzMain_function);
        }
        private bool judge = false;//判断该软件是否注册
        private void Software_registration_Load(object sender, EventArgs e)
        {
            string Link = "server=.;Database=Management_system;integrated security=SSPI;";
            using (SqlConnection con = new SqlConnection(Link)) 
            {
                string Sql = "select * from StaffID ";
                using (SqlCommand cmd = new SqlCommand(Sql, con))
                {
                    con.Open();
                    SqlDataReader red = cmd.ExecuteReader();
                    if (red.HasRows) 
                    {

                        red.Read();
                        labName.Text = (string)red[0];
                        labTime.Text = red[1].ToString();
                        labNotTime.Text = (string)red[2].ToString();
                        labID.Text = (string)red[3];
                    }
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Main_function newzMain_function = new Main_function();

            newzMain_function.TopLevel = false;
            Method.frm.panel1.Controls.Clear();
            Method.frm.panel1.Controls.Add(newzMain_function);
            newzMain_function.Show();
            Method.SetDouble(Method.frm);
        }
    }
}
